package zju.ccnt.rest.api;

import zju.ccnt.rest.domain.RankList;
import zju.ccnt.rest.service.util.sql.SqlPersistence;

import java.sql.Timestamp;

/**
 * Created by zha on 14/11/21.
 */
public class ApiReplyRankList {
    private String id;
    private ApiBusinessUser businessUser;
    private String name;
    private String description;
    private boolean isPublic;
    private String viewName;
    private Timestamp updateTime;
    private SqlPersistence sqlQuery;
    private String type;
    private int weight;

    public ApiReplyRankList(RankList rankList){
        this.id = rankList.getId();
        this.businessUser = new ApiBusinessUser(rankList.getBusinessUser());
        this.name = rankList.getName();
        this.description = rankList.getDescription();
        this.isPublic = rankList.isPublic();
        this.viewName = rankList.getViewName();
        this.updateTime = rankList.getUpdateTime();
        this.sqlQuery = rankList.getSqlQuery();
        this.type = rankList.getType().name();
        this.weight = rankList.getWeight();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public ApiBusinessUser getBusinessUser() {
        return businessUser;
    }

    public void setBusinessUser(ApiBusinessUser businessUser) {
        this.businessUser = businessUser;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isPublic() {
        return isPublic;
    }

    public void setPublic(boolean isPublic) {
        this.isPublic = isPublic;
    }

    public String getViewName() {
        return viewName;
    }

    public void setViewName(String viewName) {
        this.viewName = viewName;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public SqlPersistence getSqlQuery() {
        return sqlQuery;
    }

    public void setSqlQuery(SqlPersistence sqlQuery) {
        this.sqlQuery = sqlQuery;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
